<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
@include('include/common.inc.php');		
$time=date('Y-m-d H:i:s');		
$num = work_str($_POST["num"], 1);				
$store = work_str($_POST["store"], 1);	
$lease_id = work_str($_POST["lease_id"], 1);
$admin_name = $_SESSION['Admin'];
if($lease_id=='')
{
	$sql="insert into $TBL_LEASE (id,hou_num,store,admin_name,state,addtime) values (null,'$num','$store','$admin_name','0','$time')";
	mysql_query($sql);
	MyNotice("已經收定該房屋", 1, "cs.php");
	exit(0);
}else{
	mysql_query("update $TBL_LEASE set state=1,addtime='$time',admin_name='$admin_name' where hou_num='$num' ");
	MyNotice("已經簽約該房屋", 1, "cs.php");
	exit(0);		
}
?>